package com.timeshare.config;

import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Knife4j配置
 */
@Configuration
@EnableKnife4j
public class Knife4jConfig {
    
    @Bean
    public OpenAPI customOpenAPI() {
        return new OpenAPI()
                .info(new Info()
                        .title("TimeShare API文档")
                        .version("1.0.0")
                        .description("TimeShare 校园技能互助平台 API接口文档<br/>Copyright © 2025 TimeShare Team")
                        .contact(new Contact()
                                .name("TimeShare Team")
                                .email("timeshare@example.com"))
                        .license(new License()
                                .name("Apache License 2.0")
                                .url("http://www.apache.org/licenses/LICENSE-2.0.html")));
    }
}

